package top.dark.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Author: lijiao
 * description:
 * Create Time: 2021/3/20 13:55
 */
@Configuration
public class WebPageConfig implements WebMvcConfigurer {
    /**
     * 视图控制器：将请求映射到指定页面
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/").setViewName("login");
        registry.addViewController("/register.html").setViewName("register");
    }
}
